package com.example.order.service;

import com.example.service.IUseService;

/**
 * @Author: robert.song
 * @Date: Created in 2022/3/22
 */

public class UseStub implements IUseService {

    private final IUseService useService;

//    必须要用有参构造，因为要传入一个代理对象
    public UseStub(IUseService useService) {
        this.useService = useService;
    }

    @Override
    public String sayHello(String name) {
        if(name!=null){
            System.out.println(name);
            useService.sayHello(name);
        }
        return "不可为null";
    }
}
